package com.techysky.shiro;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import com.techysky.entity.User;
public class ShiroUtils {
    public static Subject getSubjct() {
        return SecurityUtils.getSubject();
    }
    public static User getUser() {
        Object object = getSubjct().getPrincipal();
        return (User)object;
    }
    public static String getUserId() {
        return getUser().getId();
    }
    public static void logout() {
        getSubjct().logout();
    }
    public static String getRoleId() {
        return getUser().getRoleId();
    }
}
